//
//  vistorView.swift
//  SinaWeibo
//
//  Created by paycloud110 on 16/6/2.
//  Copyright © 2016年 paycloud110. All rights reserved.
//

import UIKit

class VistorView: UIView {

    @IBOutlet weak var backCircleImageView: UIImageView!
    @IBOutlet weak var fangWuImageView: UIImageView!
    @IBOutlet weak var zhuCeButton: UIButton!
    @IBOutlet weak var loginButton: UIButton!
    @IBOutlet weak var title: UILabel!

    class func vistorView() -> VistorView {
        
        let view = NSBundle.mainBundle().loadNibNamed("VistorView", owner: self, options: nil).last as! VistorView
        return view
    }
    func setupVistorView(imageName: String?, titleLabel: String?) -> Void {
        zhuCeButton.adjustsImageWhenHighlighted = false
        loginButton.adjustsImageWhenHighlighted = false
        guard let name = imageName else
        {
            JWNLog("进来的是首页")
            return
        }
        guard let titleName = titleLabel else
        {
            JWNLog("进来的是首页")
            return
        }
        fangWuImageView.image = UIImage(named: name)
        title.text = titleName
    }
    func setupAnimation()
    {
        let animation = CABasicAnimation(keyPath: "transform.rotation")
        animation.toValue = 2 * M_PI
        animation.duration = 10
        animation.repeatCount = MAXFLOAT
        animation.removedOnCompletion = false
        backCircleImageView.layer.addAnimation(animation, forKey: nil)
    }
}
